﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;

namespace InnovTech.Wpf.UI.Dragging
{
    public static class DraggableActions
    {
        public static Action<UIElement, double, double> DragCanvasElementMethod
        {
            get
            {
                return (draggable, diffx, diffy) =>
                {
                    Canvas.SetLeft(draggable, Canvas.GetLeft(draggable) + diffx);
                    Canvas.SetTop(draggable, Canvas.GetTop(draggable) + diffy);
                };
            }
        }

        public static Action<UIElement, double, double> DragWindowMethod
        {
            get
            {
                return (draggable, diffx, diffy) =>
                    {
                        Window win = draggable as Window;
                        win.Left += diffx;
                        win.Top += diffy;
                    };
            }
        }
    }
}
